const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    proxy: {
      "/api": {
        target: "http://localhost:3000", // 目标后端服务器地址
        changeOrigin: true, // 是否改变源地址
        pathRewrite: {
          "^/api": "", // 重写路径
        },
      },
    },
  },
  css: {
    // 配置全局scss变量
    loaderOptions: {
      sass: {
        additionalData: `
          @import "@/common/css/variable.scss";
          @import "@/common/css/mixin.scss";
        `,
      },
    },
  },
});
